log using "/Users/sambell/Dropbox/Air Power and Civilian Deaths/FPA Manuscript/Final Materials/Replicaiton log.smcl", replace

*Models Table 1 in manuscript*
*model 1*
nbreg internal_collateral  air_dom_disp polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion , cluster (cowcode)
*model 2*
nbreg internal_collateral air_govt_support air_oppose_govt  polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion_sup troop_incursion_opp, cluster (cowcode) 
*model 3*
nbreg internal_collateral  air_dom_disp hrosecloc_merge air_dom_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion, cluster (cowcode)
*model 4*
nbreg internal_collateral  air_govt_support hrosecloc_merge air_govt_sup_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion_sup, cluster (cowcode)
*model 5*
 nbreg internal_collateral  air_oppose_govt hrosecloc_merge air_govt_opp_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level   troop_incursion_opp, cluster (cowcode)
 
*Figure 1 - this code generates the marginal effect predictions from table 1 - model 3. Those predictions and confidence intervals are then entered into a separate data file and plotted to produce figure 1* 
eststo clear
estsimp nbreg internal_collateral  air_dom_disp hrosecloc_merge air_dom_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion, cluster (cowcode)

setx mean
setx government 1
setx intensity_level 1
setx troop_incursion 0 

*varying value of Z*
setx hrosecloc_merge  0
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO 0 0) level(95)
setx hrosecloc_merge 1
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO 0 1) level(95)
setx hrosecloc_merge 2
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 2) level(95)
setx hrosecloc_merge 3
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 3) level(95)
setx hrosecloc_merge 4
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 4) level(95)
setx hrosecloc_merge 5
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 5) level(95)
setx hrosecloc_merge 6
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 6) level(95)
setx hrosecloc_merge 7
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 7) level(95)
setx hrosecloc_merge 8
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 8) level(95)
setx hrosecloc_merge 9
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 9) level(95)
setx hrosecloc_merge 10
simqi, fd(ev) changex(air_dom_disp 0 1  air_dom_HRO  0 10) level(95)



*Table A1*
probit internal_col_mean_di  air_dom_disp polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion , cluster (cowcode)
probit internal_col_mean_di air_govt_support air_oppose_govt  polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion_sup troop_incursion_opp, cluster (cowcode) 

*Table A2*
nbreg internal_collateral  air_dom_disp polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion report , cluster (cowcode)
nbreg internal_collateral air_govt_support air_oppose_govt  polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion_sup troop_incursion_opp report,  cluster (cowcode) 
nbreg internal_collateral  air_dom_disp hrosecloc_merge air_dom_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion report, cluster (cowcode)
nbreg internal_collateral  air_govt_support hrosecloc_merge air_govt_sup_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion_sup report, cluster (cowcode)
nbreg internal_collateral  air_oppose_govt hrosecloc_merge air_govt_opp_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level   troop_incursion_opp report, cluster (cowcode) 


*Table A3*

nbreg internal_collateral  air_dom_disp polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion humanitarian , cluster (cowcode)
nbreg internal_collateral  air_govt_support air_oppose_govt  polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion_sup troop_incursion_opp humanitarian, cluster (cowcode) 
nbreg internal_collateral  air_dom_disp hrosecloc_merge air_dom_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion humanitarian, cluster (cowcode)
nbreg internal_collateral  air_govt_support hrosecloc_merge air_govt_sup_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion_sup humanitarian, cluster (cowcode)
nbreg internal_collateral  air_oppose_govt hrosecloc_merge air_govt_opp_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level   troop_incursion_opp humanitarian, cluster (cowcode) 

*Table A4*
nbreg internal_collateral  internal_collateral_lag air_dom_disp polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion , cluster (cowcode)
nbreg internal_collateral internal_collateral_lag air_govt_support air_oppose_govt  polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion_sup troop_incursion_opp, cluster (cowcode) 
nbreg internal_collateral internal_collateral_lag air_dom_disp hrosecloc_merge air_dom_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion, cluster (cowcode)
nbreg internal_collateral internal_collateral_lag air_govt_support hrosecloc_merge air_govt_sup_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion_sup, cluster (cowcode)
nbreg internal_collateral internal_collateral_lag air_oppose_govt hrosecloc_merge air_govt_opp_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level   troop_incursion_opp, cluster (cowcode)

*Table A5*

nbreg internal_collateral  air_dom_disp polity2 ln_population GDPpercapitaconstant2005US government intensity_level HRO_dummy troop_incursion , cluster (cowcode)
nbreg internal_collateral  air_govt_support air_oppose_govt  polity2 ln_population GDPpercapitaconstant2005US government intensity_level HRO_dummy  troop_incursion_sup troop_incursion_opp, cluster (cowcode) 
nbreg internal_collateral  air_dom_disp HRO_dummy air_dom_HROdum polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion, cluster (cowcode)
nbreg internal_collateral  air_govt_support HRO_dummy air_govt_sup_HROdum polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion_sup, cluster (cowcode)
nbreg internal_collateral  air_oppose_govt HRO_dummy air_govt_opp_HROdum polity2 ln_population GDPpercapitaconstant2005US government intensity_level   troop_incursion_opp, cluster (cowcode) 

*Table A6*
nbreg internal_collateral  air_dom_disp polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion if cowcode~=2, cluster (cowcode)
nbreg internal_collateral  air_govt_support air_oppose_govt  polity2 ln_population GDPpercapitaconstant2005US government intensity_level hrosecloc_merge  troop_incursion_sup troop_incursion_opp if cowcode~=2, cluster (cowcode) 
nbreg internal_collateral  air_dom_disp hrosecloc_merge air_dom_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion if cowcode~=2, cluster (cowcode)
nbreg internal_collateral  air_govt_support hrosecloc_merge air_govt_sup_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level  troop_incursion_sup if cowcode~=2, cluster (cowcode)
nbreg internal_collateral  air_oppose_govt hrosecloc_merge air_govt_opp_HRO polity2 ln_population GDPpercapitaconstant2005US government intensity_level   troop_incursion_opp if cowcode~=2, cluster (cowcode) 

log close
